<?php
/**
 * Created by PhpStorm.
 * User: DELL
 * Date: 2017/3/13
 * Time: 22:39
 */
use yii\helpers\Html;

$this->title = '商品信息';

$intro = stripslashes($arr_goods["intro"]);
preg_match_all('/<[p|P](.*)<\/[p|P]>/U', $intro, $arr_intro);
?>
<div class="container">
<form name="onsales" method="post" action="onsales">
<div class="row">
    <?php foreach($arr_intro[0] as $key => $_intro) {?>
        <div class="col-xs-4">
            <input type="checkbox" name="intro_cb[]" value="<?php echo $key?>" checked="checked">
            <input type="hidden" name="intro_tx[]" value="<?php echo base64_encode($_intro)?>">
            <?php
            preg_match_all('/<img.*\/>/',$_intro, $arr_img);
            if ($arr_img) {
                foreach($arr_img as $_img) {
                    if (isset($_img[0])) {
                        $str = preg_replace('/<img/','<img width="320px" height="320px"',$_img[0]);
                        echo $str;
                    } else {
                        echo $_intro;
                    }
            ?>
            <?php }} ?>
        </div>
    <?php } ?>
</div>
<input name="_csrf" type="hidden" id="_csrf" value="<?= Yii::$app->request->csrfToken ?>">
<input name="goods_id" type="hidden" id="goods_id" value="<?= $arr_goods['channel'].'/'.$arr_goods['goods_id'].'/'.$arr_goods['id'] ?>">
<input type="submit" name="提交" value="submit" />
</form>
</div>
